package com.yang.flower.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.beans.Transient;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description: TODO
 * @Author: Yang
 * @DateTime: 2023/2/19 18:57
 **/
@Data
@TableName("comment")
public class Comment {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String content;

    private String username;

    private Integer userId;

    private Integer flowerId;

    private Integer pid;

    private String target;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(exist = false)
    private List<Comment> children;
}
